package com.giteelou.antlr.ps.man.symbol;

import com.giteelou.antlr.ps.man.type.Type;
import org.antlr.v4.runtime.tree.ParseTree;

/**
 * 变量
 */
public class Variable extends AbstractSymbol {
    /**
     * 变量的类型
     */
    private Type type;
    /**
     * @param name 变量的名称
     * @param node 变量关联的AST节点
     */
    public Variable(String name, ParseTree node) {
        super(name, node);
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "Variable: " + getName();
    }
}
